package com.zzp.zjs_bos.web.action;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.zzp.zjs_bos.domain.Role;
import com.zzp.zjs_bos.web.action.base.BaseAction;

@Controller
@Scope("prototype")
public class RoleAction extends BaseAction<Role> {
	
	private String functionIds;
	public void setFunctionIds(String functionIds) {
		this.functionIds = functionIds;
	}
	
	public String save(){
		roleService.save(model,functionIds);
		return "list";
	}
	
	public String findAll(){
		List<Role> list = roleService.findAll();
		String[] excludes = new String[]{"users","functions"};
		this.writeList2Json(list, excludes);
		return NONE;
	}
	
}
